package com.longge;

public class CountDigits {

    public int countDigits(int num) {

        char[] chars = String.valueOf(num).toCharArray();

        int ans = 0;

        for (int i = 0; i < chars.length; i++) {
            int n = chars[i] - '0';
            if (num % n == 0) ans++;
        }
        return ans;
    }

}
